<template>
    <el-descriptions
            class="margin-top"
            title="基本信息"
            :column="4"
            size="8px"
            border
    >
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <user />
                    </el-icon>
                    部门
                </div>
            </template>
            {{ objectInfo.info.department }}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <user />
                    </el-icon>
                    负责人
                </div>
            </template>
            {{objectInfo.info.principal}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <user />
                    </el-icon>
                    助理
                </div>
            </template>
            {{objectInfo.info.assistant}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <iphone />
                    </el-icon>
                    项目编号
                </div>
            </template>
            {{objectInfo.info.pid}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <location />
                    </el-icon>
                    项目名称
                </div>
            </template>
            {{objectInfo.info.pname}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    项目进度
                </div>
            </template>
            {{objectInfo.info.progress}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <tickets />
                    </el-icon>
                    备案号
                </div>
            </template>
            {{objectInfo.info.recordid}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    所属板块
                </div>
            </template>
            {{objectInfo.info.bk}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    委托单位
                </div>
            </template>
            {{objectInfo.info.client}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    组织方式
                </div>
            </template>
            {{objectInfo.info.bidmethod}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    招标类别
                </div>
            </template>
            {{objectInfo.info.bidcategory}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    工程类别
                </div>
            </template>
            {{objectInfo.info.enginer}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    评标办法
                </div>
            </template>
            {{objectInfo.info.bidway}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    公告开始时间
                </div>
            </template>
            {{objectInfo.info.anntimeb}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    公告截止时间
                </div>
            </template>
            {{objectInfo.info.anntimee}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    开标时间
                </div>
            </template>
            {{objectInfo.info.opentime}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    开标地点
                </div>
            </template>
            {{objectInfo.info.parea}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    估算价
                </div>
            </template>
            {{objectInfo.info.planprice}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    控制价
                </div>
            </template>
            {{objectInfo.info.controlprice}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    是否外委
                </div>
            </template>
            {{objectInfo.info.decide}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    是否依法
                </div>
            </template>
            {{objectInfo.info.law}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    是否电子标
                </div>
            </template>
            {{objectInfo.info.online}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    评委人数
                </div>
            </template>
            {{objectInfo.info.pbr}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    评标费
                </div>
            </template>
            {{objectInfo.info.pbf}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    中标单位
                </div>
            </template>
            {{objectInfo.info.wincompany}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    中标金额
                </div>
            </template>
            {{objectInfo.info.winprice}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    是否内部中标
                </div>
            </template>
            {{objectInfo.info.inn}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    预定标时间
                </div>
            </template>
            {{objectInfo.info.stime}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    定标时间
                </div>
            </template>
            {{objectInfo.info.ftime}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    归档时间
                </div>
            </template>
            {{objectInfo.info.gdtime}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    上架时间
                </div>
            </template>
            {{objectInfo.info.sjtime}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    档案号
                </div>
            </template>
            {{objectInfo.info.sjnum}}
        </el-descriptions-item>
        <el-descriptions-item>
            <template #label>
                <div class="cell-item">
                    <el-icon>
                        <office-building />
                    </el-icon>
                    备注
                </div>
            </template>
            {{objectInfo.info.remark}}
        </el-descriptions-item>
        <template #extra>
            <el-button type="primary" @click="goback">返回</el-button>
        </template>
    </el-descriptions>
    <el-descriptions
            class="margin-top"
            title="投标信息"
            :column="4"
            size="8px"
            border
    ></el-descriptions>
    <el-table :data="bidTableList.infoList" border style="width: 100%" max-height="300">
        <el-table-column v-for="(item, index) in tableHeaderList" :key="item.id" align="center" :prop="item.prop" :label="item.label" :width="item.width" :fixed="index === 0 ? true : false" >
        </el-table-column>
    </el-table>
</template>

<script setup>
    import {useRoute, useRouter} from "vue-router";
    import {onMounted} from 'vue'
    //身份标识
    const router = useRouter()
    const route = useRoute()
    //引入接口路径
    import pageApi from '@/api/page.js'
    let objectInfo = reactive({
        info: {}
    })
    // 投标信息list
    let bidTableList = reactive({
        infoList: []
    })
    const tableHeaderList = ref([
        {
            id: 1,
            label: '投标单位名称',
            prop: 'tname',
            width: 200,
            flag: '1'
        },
        {
            id: 2,
            label: '投标金额(元)',
            prop: 'tprice',
            width: 120,
            flag: '1'
        },
        {
            id: 3,
            label: '投标状态',
            prop: 'state',
            width: 120,
            flag: '1'
        },
        {
            id: 4,
            label: '预定标价(元)',
            prop: 'rprice',
            width: 120,
            flag: '1'
        },
        {
            id: 5,
            label: '中标价(元)',
            prop: 'winprice',
            width: 120,
            flag: '3'
        },
        {
            id: 6,
            label: '中标服务费(元)',
            prop: 'serprice',
            width: 120,
            flag: '3'
        },
        {
            id: 7,
            label: '备注',
            prop: 'remark',
            width: 200,
            flag: ''
        },
        {
            id: 8,
            label: '保证金金额(元)',
            prop: 'cash',
            width: 120,
            flag: '2'
        },
        {
            id: 9,
            label: '退款金额(元)',
            prop: 'rcash',
            width: 120,
            flag: '2'
        },
        {
            id: 10,
            label: '退款时间',
            prop: 'rtime',
            width: 170,
            flag: '2'
        },
        {
            id: 11,
            label: '服务费开票金额(元)',
            prop: 'invoceprice',
            width: 160,
            flag: '2'
        },
        {
            id: 12,
            label: '服务费开票时间',
            prop: 'invocetime',
            width: 170,
            flag: '2'
        },
        {
            id: 13,
            label: '发票号',
            prop: 'invoceid',
            width: 150,
            flag: '2'
        },
        {
            id: 14,
            label: '文件费开票金额(元)',
            prop: 'wjprice',
            width: 170,
            flag: '2'
        },
        {
            id: 15,
            label: '文件费开票时间',
            prop: 'wjtime',
            width: 170,
            flag: '2'
        },
        {
            id: 16,
            label: '联系人',
            prop: 'lxr',
            width: 120,
            flag: '1'
        },
        {
            id: 17,
            label: '联系电话',
            prop: 'telephone',
            width: 140,
            flag: '1'
        }
    ])
    onMounted(() => {
            getObject()
        });
    //搜索项目详情
    const getObject = async () => {
        const id = route.query.id
        const res = await pageApi.getObject({ id })
        objectInfo.info = res.data;
        bidTableList.infoList = res.data.tenders;
    }
    //添加返回
    const goback = ()=>{
        router.push({
            path: '/data-center/bid/list'
        })
    }
</script>

<style scoped>
    .cell-item {
        display: flex;
        align-items: center;
    }
    .margin-top {
        margin-top: 20px;
    }
</style>
